package com.yanjr.modules.cms.entity;

import java.util.Date;

import org.springframework.stereotype.Component;

import com.yanjr.common.Constants;
import com.yanjr.common.persistence.DataEntity;
import com.yanjr.common.persistence.Annotation.Column;
import com.yanjr.common.persistence.Annotation.Database;
import com.yanjr.common.persistence.Annotation.Table;

/**
 * 链接Entity
 * @ClassName: Link 
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author yanjr  2016年5月25日 下午3:49:51
 */
@Database("jeesite")
@Table("cms_link")
@Component
public class Link extends DataEntity<Link> {
	private static final long serialVersionUID = 1L;
	
	@Column("id")
	private String id;
	@Column("category_id")
	private String categoryId;//栏目编号
	private Category category;// 分类编号
	@Column("title")
	private String title;	// 链接名称
	@Column("color")
	private String color;	// 标题颜色（red：红色；green：绿色；blue：蓝色；yellow：黄色；orange：橙色）
	@Column("image")
	private String image;	// 链接图片
	@Column("href")
	private String href;	// 链接地址
	@Column("weight")
	private Integer weight;	// 权重，越大越靠前
	@Column("weight_date")
	private Date weightDate;// 权重期限，超过期限，将weight设置为0
	@Column("create_by")
	private String createBy;
	@Column("create_date")
	private Date createDate;
	@Column("update_by")
	private String updateBy;
	@Column("update_date")
	private Date updateDate;
	@Column("remarks")
	private String remarks;
	@Column("del_flag")
	private String delFlag = Constants.DEL_FLAG_NORMAL;

	public Link() {
		super();
		this.weight = 0;
	}
	
	public Link(String id){
		this();
		this.id = id;
	}
	
	public Link(Category category) {
		this();
		this.category = category;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
		this.categoryId = category.getId();
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getHref() {
		return href;
	}

	public void setHref(String href) {
		this.href = href;
	}

	public Integer getWeight() {
		return weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

	public Date getWeightDate() {
		return weightDate;
	}

	public void setWeightDate(Date weightDate) {
		this.weightDate = weightDate;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	
}